import request from '@/utils/request'

export default {
  // 1.添加课程信息
  addCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/course/addCourseInfo`,
      method: 'post',
      data: courseInfo
    });
  },
  // 2.根据id查询课程信息
  getCourseInfo(courseId) {
    return request({
      url: `/eduservice/course/getCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  // 3.修改课程信息
  updateCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/course/updateCourseInfo`,
      method: 'post',
      data: courseInfo
    });
  },
  // 4.课程确认信息的显示
  getPublishCourseInfo(courseId) {
    return request({
      url: `/eduservice/course/getPublishCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  // 5.课程最终发布
  publishCourse(courseId) {
    return request({
      url: `/eduservice/course/publishCourse/${courseId}`,
      method: 'put'
    })
  },
  // 6.分页条件查询课程信息
  pageCourseCondition(current, limit, query) {
    return request({
      url: `/eduservice/course/pageCourseCondition/${current}/${limit}`,
      method: 'post',
      data: query
    })
  },
  // 7.删除课程信息
  deleteCourse(courseId) {
    return request({
      url: `eduservice/course/${courseId}`,
      method: 'delete'
    })
  }
}
